//
//  SleepHRVHintView.swift
//  DaRings
//
//  Created by 易先生 on 2022/11/3.
//

import UIKit
import MYModule

open class SleepHeartHintView: View {

    public override func makeUI() {
        super.makeUI()
        
        self.addSubview(iconImageView)
        self.addSubview(descLabel)
        self.addSubview(statusLabel)
        
        iconImageView.snp.makeConstraints { make in
            make.leading.equalToSuperview().offset(20)
            make.size.equalTo(CGSize(width: 28, height: 28))
            make.top.bottom.equalToSuperview()
        }
        
        descLabel.snp.makeConstraints { make in
            make.leading.equalTo(iconImageView.snp.trailing).offset(10)
            make.centerY.equalToSuperview()
            make.trailing.equalTo(statusLabel.snp.leading).offset(-10)
        }
        
        statusLabel.snp.makeConstraints { make in
            make.trailing.equalToSuperview().offset(-20)
            make.centerY.equalToSuperview()
        }
        
    }

    public func setSleepStatus(stateStr: String) {
        statusLabel.text = stateStr
    }
    
    public lazy var iconImageView: ImageView = {
        let iconImageView = ImageView()
        iconImageView.image = UIImage(named: "ic_sleep_hrv_risk")
        return iconImageView
    }()
    
    public lazy var descLabel: Label = {
        let descLabel = Label()
        descLabel.text = "sleep_apnea_risk".language
        descLabel.textColor = UIColor.assist_222222
        descLabel.numberOfLines = 0
        descLabel.font = Fonts.systemFont(ofSize: 14, weight: .medium)
        return descLabel
    }()
    
    public lazy var statusLabel: Label = {
        let statusLabel = Label()
        statusLabel.textColor = UIColor.Sleep.theme
        statusLabel.font = Fonts.boldSystemFont(ofSize: 16)
        return statusLabel
    }()

}
